def isleap(x):
    if (x%4==0 and x%100 != 0)or x%400==0:
        return True
    else:return False
monthes_leap=[31,29,31,30,31,30,31,31,30,31,30,31]
monthes=[31,28,31,30,31,30,31,31,30,31,30,31]
days=2
cnt=0
for year in xrange(1901,2001):
    if isleap(year):
        for month in xrange(12):
            days+=monthes_leap[month]
            days=days%7
            if days%7==0:cnt+=1
    else:
        for month in xrange(12):
            days+=monthes[month]
            days=days%7
            if days%7==0:cnt+=1
print cnt
        
